﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Account_Login : System.Web.UI.Page, ILoginView
{
    LoginPresenter _presenter;
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
        _presenter = new LoginPresenter(this);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        RegisterHyperLink.NavigateUrl = "Register.aspx?ReturnUrl=" + HttpUtility.UrlEncode(Request.QueryString["ReturnUrl"]);
    }

    public string loginName
    {
        get { return LoginUser.UserName; }
    }

    public string password
    {
        get { return LoginUser.Password; }
    }
    protected void LoginUser_Authenticate(object sender, AuthenticateEventArgs e)
    {
        e.Authenticated = _presenter.Login();
    }
}
